{% load static %}
{% include 'Header.html' %}
        
        {% csrf_token %}
        <div class="bootstrap-dark">
            <div class="dashboard-content">

                <div class="row">
                    <!-- ============================================================== -->
                    <!-- valifation types -->
                    <!-- ============================================================== -->
                    <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                        <div class="card">
                            {% for message in messages %}
                                  <div class="alert alert-success alert-dismissible fade show" role="alert">
                                    
                                    {{message}} 
                                    
                                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                      <span aria-hidden="true">&times;</span>
                                    </button>
                                  </div>
                                  {% endfor %}



                            <h5 class="card-header text-white">Edit Company</h5>
                            <div class="card-body">
                                <form id="validationform" method="POST", action="/company/edit"  enctype="multipart/form-data">{% csrf_token %}
                                    <div class="form-group row">
                                        <label class="col-12 col-sm-3 col-form-label text-sm-right text-white">Name</label>
                                        <div class="col-12 col-sm-8 col-lg-6">
                                            <input type="hidden" required="" name="company" value="{{company.pk}}">
                                            <input type="text" required="" name="name" placeholder="Type something" class="form-control" value="{{company.name}}">
                                        </div>
                                    </div>

                                    <div class="form-group row">
                                        <label class="col-12 col-sm-3 col-form-label text-sm-right text-white">Logo</label>
                                        <div class="col-12 col-sm-8 col-lg-6">
                                            {% if company.img.url != None %}
                                    <img src="{{company.img.url}}" width="500" class="img-thumbnail"/>
                                    {% endif %}
                                    
                                </div>
                                </div>


                                <div class="form-group row">
                                    <label class="col-12 col-sm-3 col-form-label text-sm-right text-white">Logo</label>
                                    <div class="col-12 col-sm-8 col-lg-6">
                                        
                                        <input class="form-control fileupload" name="image"type="file" id="formFile">
                                
                            </div>
                            </div>


                                    <div class="form-group row">
                                        <label class="col-12 col-sm-3 col-form-label text-sm-right text-white">Address</label>
                                        <div class="col-12 col-sm-8 col-lg-6">
                                            <textarea required="" name="address" placeholder="Type something" class="form-control">{{company.address}}</textarea>
                                        </div>
                                    </div>
                                    <div class="form-group row text-right">
                                        <div class="col col-sm-10 col-lg-9 offset-sm-1 offset-lg-0">
                                            <button type="submit" class="btn btn-space btn-primary">Submit</button>
                                            
                                            <a href="/company/"><button type="button" class="btn btn-space btn-secondary">Cancel</button> </a>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                   
                </div>
                


                       
                    
                </div>
            </div>
           
            <div class="footer bootstrap-dark">
                <div class="container-fluid bootstrap-dark">
                    <div class="row">
                        <div class="col-xl-6 col-lg-6 col-md-12 col-sm-12 col-12">
                            Copyright © 2022 APTRS. All rights reserved. Dashboard by <a href="https://colorlib.com/wp/">Colorlib</a>.
                        </div>
                        
                    </div>
                </div>
            </div>
            <!-- ============================================================== -->
            <!-- end footer -->
            <!-- ============================================================== -->
        </div>
    </div>
    
    <script src="{% static "vendor/jquery/jquery-3.3.1.min.js" %}"></script>
    <script src="{% static "vendor/bootstrap/js/bootstrap.bundle.js" %}"></script>
   
</body>
 
</html>
